import numpy as np

def cross_entropy_error(y,t):
    if y.size != t.size:
        return "size is not equal!"
    delta = 1e-7    # .0000007 add a small number to avoid the log(0) that is a -infinity
    return -np.sum(t*np.log(y+delta))